// 自定义国际化配置
import { createI18n } from 'vue-i18n';
import enUS from './en_US';
import zhCN from './zh_CN';

const messages = {
  'en-US': enUS,
  'zh-CN': zhCN
};

const i18n = createI18n({
  legacy: false,
  locale: uni.getStorageSync('language') || 'zh-CN',
  fallbackLocale: 'zh-CN',
  messages,
  globalInjection: true,
  silentTranslationWarn: true,
  missingWarn: false,
  silentFallbackWarn: true
});

export default i18n;

export type LanguageType = typeof zhCN;
